class CreateMaterialApoios < ActiveRecord::Migration
  def self.up
    create_table :material_apoios do |t|
      t.references :disciplina
      t.date :data, :null => false
      t.string :descricao, :limit => 100, :null => false
      t.datetime :hora, :null => false
      t.string :anexo_mate_apoio, :limit => 10, :null => false
      
      t.timestamps
    end
  
  execute("alter table material_apoios add foreign key (disciplina_id) references disciplinas(id)")

  end

  def self.down
    drop_table :material_apoios
  end
end
